package com.ffcs.crmd.tsp.admin.service;

import java.util.List;

import com.ctg.itrdc.platform.common.entity.PageInfo;
import com.ffcs.crmd.tsp.admin.entity.JobDetail;
import com.ffcs.crmd.tsp.admin.entity.JobDetailRetry;
import com.ffcs.crmd.tsp.admin.entity.JobDetailRunning;
import com.ffcs.crmd.tsp.admin.entity.JobDetailThreadInfo;
import com.ffcs.crmd.tsp.common.exception.TspException;

public interface IJobDetailService {

    /**
     * 功能说明:
     * 
     * @param jobDetail
     * @throws TspException
     */
    void addJobDetail(JobDetail jobDetail) throws TspException;

    /**
     * 功能说明:
     * 
     * @param jobDetailList
     * @throws TspException
     */
    void addJobDetail(List<JobDetail> jobDetailList) throws TspException;

    /**
     * 功能说明:
     * 
     * @param jobDetail
     * @throws TspException
     */
    void deleteJobDetail(JobDetail jobDetail) throws TspException;

    /**
     * 功能说明:
     * 
     * @param jobDetailList
     * @throws TspException
     */
    void deleteJobDetail(List<JobDetail> jobDetailList) throws TspException;

    /**
     * 功能说明:
     * 
     * @param jobDetailRunning
     * @return
     * @throws TspException
     */
    void finish(JobDetailRunning jobDetailRunning) throws TspException;

    /**
     * 功能说明:
     * 
     * @param jobDetailRunningList
     * @throws TspException
     */
    void finish(List<JobDetailRunning> jobDetailRunningList) throws TspException;

    /**
     * 功能说明:
     * 
     * @param clusterName
     * @param jobName
     * @param id
     * @return
     * @throws TspException
     */
    void interrupt(JobDetailRunning jobDetailRunning) throws TspException;
    
    /**
     * 功能说明:
     * 
     * @param jobDetailRunningList
     * @return
     * @throws TspException
     */
    void interrupt(List<JobDetailRunning> jobDetailRunningList) throws TspException;

    /**
     * 功能说明:
     * 
     * @param jobDetail
     * @throws TspException
     */
    void pasueJobDetail(JobDetail jobDetail) throws TspException;

    /**
     * 功能说明:
     * 
     * @param jobDetailList
     * @throws TspException
     */
    void pasueJobDetail(List<JobDetail> jobDetailList) throws TspException;

    /**
     * 功能说明:
     * 
     * @param clusterName
     * @param name
     * @param jobId
     * @return
     * @throws TspException
     */
    List<JobDetail> query(JobDetail jobDetail) throws TspException;

    /**
     * 功能说明:
     * 
     * @param clusterName
     * @param name
     * @param jobId
     * @param pageNumber
     * @param pageSize
     * @return
     * @throws TspException
     */
    PageInfo<JobDetail> queryPage(JobDetail jobDetail, int pageNumber, int pageSize) throws TspException;


    /**
     * 功能说明:
     * 
     * @param clusterName
     * @param name
     * @param pageNumber
     * @param pageSize
     * @return
     * @throws TspException
     */
    PageInfo<JobDetailRetry> queryRetryPage(JobDetailRetry jobDetailRetry, int pageNumber, int pageSize) throws TspException;

    /**
     * 功能说明:
     * 
     * @param clusterName
     * @param name
     * @param addr
     * @param id
     * @param status
     * @param pageNumber
     * @param pageSize
     * @return
     * @throws TspException
     */
    PageInfo<JobDetailRunning> queryRunningPage(JobDetailRunning jobDetailRunning, int pageNumber, int pageSize) throws TspException;

    /**
     * 功能说明:
     * 
     * @param clusterName
     * @param jobName
     * @param id
     * @return
     * @throws TspException
     */
    JobDetailThreadInfo queryThreadInfo(JobDetailRunning jobDetailRunning) throws TspException;

    /**
     * 功能说明:
     * 
     * @param jobDetailRunning
     * @return
     * @throws TspException
     */
    void reset(JobDetailRunning jobDetailRunning) throws TspException;

    /**
     * 功能说明:
     * 
     * @param jobDetailRunningList
     * @return
     * @throws TspException
     */
    void reset(List<JobDetailRunning> jobDetailRunningList) throws TspException;

    /**
     * 功能说明:
     * 
     * @param jobDetail
     * @throws TspException
     */
    void resumeJobDetail(JobDetail jobDetail) throws TspException;

    /**
     * 功能说明:
     * 
     * @param jobDetailList
     * @throws TspException
     */
    void resumeJobDetail(List<JobDetail> jobDetailList) throws TspException;

    /**
     * 功能说明:
     * 
     * @param clusterName
     * @param id
     * @return
     * @throws TspException
     */
    JobDetail get(JobDetail jobDetail) throws TspException;

}
